

#ifndef VNS_VNSENVIR_H
#define VNS_VNSENVIR_H


#include "envirbase.h"

class VNSEnvir : public EnvirBase {
private:
	cStaticFlag* flag;

protected:
    virtual void run(){};


protected:
  // new simulation options:
  opp_string opt_configname;
  size_t opt_extrastack;
  opp_string opt_outputfile;

  bool opt_expressmode;
  bool opt_interactive;
  bool opt_autoflush; // all modes
  bool opt_modulemsgs;  // if normal mode
  bool opt_messagetrace; // if normal mode
  bool opt_perfdisplay; // if express mode

  // stream to write output to
  FILE *fout;

protected:
  virtual void sputn(const char *s, int n);
  virtual void putsmsg(const char *s);
  virtual bool askyesno(const char *question);

public:
public:
	VNSEnvir();
	virtual ~VNSEnvir();

	void onSimulationStart();
	void onSimulationStop();

	virtual int run(int argc, char *argv[], cConfiguration *cfg);

  // redefined virtual funcs:
  virtual void componentInitBegin(cComponent *component, int stage);
  virtual void moduleCreated(cModule *newmodule);
  virtual void messageSent_OBSOLETE(cMessage *msg, cGate *directToGate);
  virtual void simulationEvent(cMessage *msg);
  virtual bool isGUI() const {return false;}
  virtual cEnvir& flush();
  virtual std::string gets(const char *prompt, const char *defaultReply);

  virtual unsigned getExtraStackForEnvir() const;

protected:
  virtual void printUISpecificHelp();

  virtual void readOptions();
  virtual void readPerRunOptions();
  virtual void askParameter(cPar *par, bool unassigned);

};


#endif

